<template>
  <div class="dialog-view">
    <div class="dialog-box">
      <div class="header">
        <div class="title">操作日志</div>
        <i class="el-icon-close" @click="closeEvent"></i>
      </div>
      <div class="content">
        <el-table :data="tableData" style="width: 100%" border height="300">
          <el-table-column prop="operator" label="操作人" width="92"></el-table-column>
          <el-table-column prop="action" label="动作" width="92"></el-table-column>
          <el-table-column prop="activeArea" label="操作区域"></el-table-column>
          <el-table-column prop="activeHandle" label="操作事件" width="156"></el-table-column>
          <el-table-column prop="ipAddress" label="IP地址"></el-table-column>
        </el-table>
      </div>
      <div class="footer">
        <el-button type="primary" size="mini" @click="closeEvent">确定</el-button>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      tableData: [
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
        {
          operator: '张三',
          action: '更新',
          activeArea: '私人空间',
          activeHandle: '2020-04-02 10:20',
          ipAddress: '192.169.20.332'
        },
      ]
    }
  },
  mounted() {
    this.stopMove()
  },
  beforeDestroy() {
    this.move()
  },
  methods: {
    closeEvent() {
      this.$emit('closeEvent')
    },
    stopMove(){
      let m = function(e){e.preventDefault();};
      document.body.style.overflow='hidden';
      document.addEventListener("touchmove",m,{ passive:false });//禁止页面滑动
    },
    move(){
      let m =function(e){e.preventDefault();};
      document.body.style.overflow='';//出现滚动条
      document.removeEventListener("touchmove",m,{ passive:true });
    }
  }
}
</script>

<style lang="less" scoped>
.dialog-view {
  position: fixed;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  .dialog-box {
    position: relative;
    width: 690px;
    background-color: #fff;
    box-shadow: 0px 3px 10px rgb(222, 221, 221);
    border-radius: 4px;
    .header {
      height: 36px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 20px;
      background-color: #edeef3;
      .title {
        font-size: 14px;
        font-weight: bold;
        color: #152640;
      }
      i {
        font-size: 18px;
        cursor: pointer;
      }
    }
  }
  .content {
    padding: 20px 30px;
  }
  .footer{
    width: 100%;
    display: flex;
    justify-content: flex-end;
    padding: 20px 30px;
    background-color: #fff;
  }
}
/deep/ .cell{
  font-size: 12px;
}
/deep/ th .cell{
  color: #AFAFB3;
}
</style>